<?php
if ($this->session->userdata('logged_in') == TRUE) {
    $this->load->view('view_login_success');
}
?>
<?php $this->load->view('view_pageheader'); ?>
<script language="JavaScript" type="text/javascript">
  function validateForm() {
      if(document.form2.fname.value==""){
          alert("You didn't enter a MENU NAME");
           return false;
      }
      else if(document.form2.fname2.value==""){
          alert("You didn't enter a LINK");
           return false;
      }
      else if (document.form2.gmenu_id[''].checked == false) {
        alert ( "Please choose Group Menu" );
         return false;
    }
      
    else {
          return true;}
  }
</script>
    <label class="content_linkBack"><a onClick='window.history.go(-1)'>< Back</a></label>
    <label class="content_this">| NEW MENU</label>
<?php 
$attributes = array( 'id' => 'myform','name'=>'form2','onsubmit'=>'return validateForm();');
echo form_open('con_users/new_menu2',$attributes); ?>
        <table border="0" style="margin: auto;">
            <tr>
                <td><label class="textRight">MENU NAME :</label></td>
                <td><input type="text" name="fname" size="20" />*</td>
            </tr>
            <tr>
                <td><label class="textRight">LINK :</label></td>
                <td><input type="text" name="fname2" size="50" />*</td>
            </tr>
             <tr>
                <td><label class="textRight">Group Menu :</label></td>
                <?php foreach ($group as $row) { ?>
                <tr>
                    <td></td>
                    <td>
                        <?php
                        echo '<input type="checkbox" name="gmenu_id[]" id="gmenu_id" value="' . $row->gmenu_id . '" />' . $row->gmenu_name . '';
                        ?>
                    </td>
                </tr>
            <?php } ?>
        </tr>
                 
        <tr><?php foreach ($menuid as $row) { ?>
                <td>
                    <?php
                    echo '<input type="hidden" name="menuidmax" id="menuidmax" value="' . $row->menu_id . '" />';
                    ?>
                </td> 
            <?php } ?>
        </tr>
                
            <tr>
                <td colspan="2" style="text-align: center;">
                    <input type="submit" value="Submit" />&nbsp;<input type="reset" value="Cancel" />
                </td>
            </tr>
        </table>
<?php echo form_close(); ?>
    
<?php $this->load->view('view_pagefooter'); ?>
    